package com.spring.housing.other;

import com.spring.housing.returnType.CommenResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;


import java.util.HashMap;
import java.util.Map;

@ControllerAdvice(basePackages = "com.spring.housing.controller.commen")
public class ErroeHandel {
    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public CommenResult exceptionHandler(Exception e){
   return  new CommenResult(500,"后端服务器异常",e.getMessage());
    }

}
